//
//  NSString+StringsizeWithMyFont.m
//
//  Created by Andrey Kadochnikov on 29.11.13.
//  Copyright (c) 2013 Andrey Kadochnikov. All rights reserved.
//

#import "NSString+StringsizeWithFont.h"

@implementation NSString (StringsizeWithFont)


-(CGSize)ceiledSize:(CGSize)size{
	size.height = ceilf(size.height);
	size.width = ceilf(size.width);
	return size;
}

- (CGSize) sizeWithMyFont:(UIFont *)fontToUse
{
    return [self sizeWithFont:fontToUse];
}

- (CGSize) sizeWithMyFont:(UIFont *)fontToUse constrainedToMySize:(CGSize)size
{
    return [self sizeWithFont:fontToUse constrainedToSize:size];
}
-(CGSize)sizeWithMyFont:(UIFont *)font forMyWidth:(CGFloat)width myLineBreakMode:(NSLineBreakMode)lineBreakMode
{
    return [self sizeWithFont:font constrainedToSize:CGSizeMake(width, MAXFLOAT) lineBreakMode:lineBreakMode];

}

-(CGSize)sizeWithMyFont:(UIFont *)font constrainedToMySize:(CGSize)size myLineBreakMode:(NSLineBreakMode)lineBreakMode
{
    return [self sizeWithFont:font constrainedToSize:size lineBreakMode:lineBreakMode];
}

-(void)drawInRect:(CGRect)rect withMyFont:(UIFont *)fontToUse myColor:(UIColor*)color
{
    
    [self drawInRect:rect withFont:fontToUse];
}

-(void)drawInRect:(CGRect)rect withMyFont:(UIFont *)font myLineBreakMode:(NSLineBreakMode)lineBreakMode myAlignment:(NSTextAlignment)alignment myColor:(UIColor*)color
{
    
    [self drawInRect:rect withFont:font lineBreakMode:lineBreakMode alignment:alignment];
}
@end
